import request from '@/utils/request.js'
import { useTokenStore } from '@/stores/token.js'

// 获取所有邮件（用于统计分析，不分页）
export const getAllEmails = () => {
    return request.get('/selectEmailList')
}

// 分页获取邮件列表（用于数据展示）
export const getEmailList = (params = {}) => {
    const defaultParams = {
        page: 1,
        pageSize: 10,
        ...params
    }
    return request.get('/selectEmailList', { params: defaultParams })
}

// 修改邮件
export const updateEmail = (id, emailData) => {
    return request.put(`/update_email/${id}`, emailData)
}

// 删除邮件（软删除）
export const deleteEmail = (id) => {
    return request.delete(`/update_email/${id}`)
}


